package day_2022_9_to_12.Day;

import java.util.Arrays;

/**
 * @author haomin
 * @date 2022/09/14 11:20
 **/
public class Day12_1_Num1619_TrimMean {
    class Solution {
        public double trimMean(int[] arr) {
            Arrays.sort(arr);
            int len = arr.length;
            int count = (int)(len * 0.05);
            int l = count, r = len - count - 1;
            double ans = 0;
            for(int i = l; i <= r; ++i){
                ans += arr[i];
            }
            return ans / (len - 2*count);
        }
    }
}